import request from '@/utils/request'

// 文章列表
export function list (query) {
  return request({
    url: '/blog-core/front/article/list',
    method: 'get',
    params: query
  })
}

// 文章详情
export function detail (id) {
  return request({
    url: '/blog-core/front/article/' + id,
    method: 'get'
  })
}

// 日期归档
export function archive (size) {
  return request({
    url: '/blog-core/front/article/archive',
    method: 'get',
    params: { size }
  })
}

// 热门文章
export function popular (size) {
  return request({
    url: '/blog-core/front/article/popular',
    method: 'get',
    params: { size }
  })
}

// 随机文章
export function random (size) {
  return request({
    url: '/blog-core/front/article/random',
    method: 'get',
    params: { size }
  })
}

// 相关文章
export function relate (id, size) {
  return request({
    url: '/blog-core/front/article/relate',
    method: 'get',
    params: { id, size }
  })
}
